package com.hudongwx.sadpw;

import android.app.Application;
import android.content.SharedPreferences;

import org.xutils.x;

/**
 * Author:Literary
 * DateTime:16-12-12 下午3:09
 */
public class MyApplication extends Application {
    public static String Uid="99";//用于记录登陆状态，如果为1表示登陆成功
    private static SharedPreferences sharedPreferences;
    @Override
    public void onCreate() {
        super.onCreate();
        sharedPreferences=getSharedPreferences("uid",MODE_PRIVATE);
        x.Ext.init(this);
        x.Ext.setDebug(true);
    }

    //保存登陆状态
    public static void saveSta(String string){
        SharedPreferences.Editor editor=sharedPreferences.edit();
        editor.putString("Uid",string);
        editor.commit();
    }
    //获得登陆之后的状态
    public static String getStatus(String str){
        String status = sharedPreferences.getString(str, "没有数据哦，少年不要搞事");
        return status;
    }
}
